'''
Created on Aug 25, 2011

@author: david
'''

from pspy.gae.actiondomain import PspyAction

class Clear(PspyAction):
    """
    Default Action 
    spawns index.gen
    """
    def execute(self): 
        """
        Receive results of scan...
        """
        import logging
        
        nxtPage = "/Ranger/Clear.gen"
        req = self.request
        
        logging.info("~~ Resetting Session...")

        for k in req.session.keys():
            del(req.session[k])
                           
        # pack and go
        req.setAttribute("results","100::Ok")
        req.setAttribute("full",1)    
        req.setResponsePage(nxtPage)        
        
        # all done
        return req.getResponse()
    
    def sess_check(self):
        return True